import React, { Component } from 'react';
import { Input, Cascader, DatePicker, Space,Button } from 'antd';
// 引入样式
import './index.css';
const options = [
    {
        value: 'zhejiang',
        label: 'Zhejiang',
    },
    {
        value: 'jiangsu',
        label: 'Jiangsu',
    },
];
const { RangePicker } = DatePicker;
class AddExam extends Component {
    // 时间
    state = {
        size: '',
    };

    render() {
        function onChange(value: any) {
            console.log(value);
        }
      
        return (
            <div >
                <div className="box1">
                    <p>试卷名称</p>
                    <Input className="input" placeholder="请输入试卷名称" />
                </div>

                {/* 下拉 */}
                <div className="box1">
                    <p>选择考试类型</p>
                    <Cascader options={options} onChange={onChange} changeOnSelect />
                </div>

                {/* 选择课程 */}
                <div className="box1">
                    <p>选择课程</p>
                    <Cascader options={options} onChange={onChange} changeOnSelect />
                </div>

                {/* 设置题量 */}
                <div className="box1">
                    <p>设置题量</p>
                    <Input className="input1" placeholder="请设置题量" />
                </div>

                <div className="box1">
                    <p>考试时间：</p>
                    <Space direction="vertical" >
                    
                        <RangePicker onChange={(e)=>this.handleSizeChange(e)} />
                    </Space>
                </div>

                <div>
                <Button type="primary">创建试卷</Button>
                </div>
            </div>
        );
        // 方法
    }
    handleSizeChange = (e:any) => {
        this.setState({ size: e.target.value });
      };
}

export default AddExam;
